package com.hdax.dm.feign.order;

import com.hdax.dm.entity.order.OrderCondition2Vo;
import com.hdax.dm.entity.order.DmOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("dm-order-provider")
public interface DmOrderFeign {

    /**
     * 删除订单
     * @param orderNo
     * @return
     */
    @PostMapping(path = "/order/deleteOrder")
    int deleteOrder(@RequestParam("orderNo")String orderNo);

    /**
     * 添加订单
     * @param dmOrder
     * @return
     */
    @PostMapping(path = "/order/addOrder")
    int addOrder(@RequestBody DmOrder dmOrder);

    /**
     * 查询订单
     * @param orderNo
     * @return
     */
    @PostMapping(path = "/order/findOrder")
    DmOrder findOrder(@RequestParam("orderNo")String orderNo);


    /**
     * 查询所有订单
     * @param keyword
     * @param startTime
     * @param endTime
     * @param orderType
     * @return
     */
    @PostMapping("/order/findAllOrder")
    List<DmOrder> findAllOrder(@RequestBody OrderCondition2Vo orderCondition2Vo);

    /**
     * 修改订单
     * @param dmOrder
     * @return
     */
    @PostMapping(path = "/order/updateOrder")
    int updateOrder(@RequestBody DmOrder dmOrder);
}
